package com.JinYuan.config;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author 金园
 * @create 2022/5/7
 * @Description
 * @className AopConfig
 * @packageName com.JinYuan.config
 */

@Aspect
@Component
public class AopConfig {

    //切入点表达式
    @Pointcut("execution(* com.JinYuan.service.impl.*.*(..))")
    public void pc(){}
    //增强内容
    
    @Before("pc()")
    public void BeFore(){
        System.out.println("在方法之前执行");
    }
    @After("pc()")
    public void After(){
        System.out.println("在方法之后执行");
    }
}
